
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">
	
<body> 
 <ui:composition template="/templates/default/template.xhtml">
    <ui:define name="body">
      
    <h:panelGrid columns="1" style="margin-left:30px;width:100%">
    	<!--  tieu de -->
    	<h:panelGrid columns="1" styleClass="columPanelbaritemTitle">
	  		<h:outputText value="Thông tin thành viên" styleClass="panelbaritemTitle"></h:outputText>
	  	</h:panelGrid>
	  	<!-- ket thuc tieu de -->
		<!-- phan noi dung phia duoi -->	  
    	<h:panelGrid columns="1" styleClass="panelGridBody">
    			<!-- Bat dau noi dung ben trong -->
		    <rich:panel style="background:#FFFFFF">
		    <h:form id="taomoidoanra">  
		    	<h:panelGrid columns="1" style="margin-left:10px;">
		    		<h:outputText id="idError" value="#{nguoiDi.error}" style=" color: red;"></h:outputText>
				</h:panelGrid>	
				<h:panelGrid columns="2" style="margin-left:10px;">
		    		<h:outputText value="Mã đoàn : " style="margin-left:15px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="mD" readonly="true" style="margin-left:42px;" value="#{nguoiDi.maDoan}" size="20"/>
		    		
		    		<h:outputText value="Số HC(*): " style="margin-left:15px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText  value="#{nguoiDi.soHC}" readonly="#{nguoiDi.state}" style="margin-left:42px;" id="text" size="20">
		    		<a4j:support event="onblur" reRender="idout" 
						action="#{nguoiDi.getInfor}"/>
		    		</h:inputText>
		    		<h:panelGrid columns="1">
						 <rich:suggestionbox  id="suggestionBoxId" for="text" tokens=",["
			                rules="#{suggestionBoxHC.rules}"
			                suggestionAction="#{suggestionBoxHC.autocomplete}" var="result"
			                fetchValue="#{result.text}" rows="#{suggestionBoxHC.intRows}"
			                first="#{suggestionBoxHC.intFirst}"
			                minChars="#{suggestionBoxHC.minchars}"
			                shadowOpacity="#{suggestionBoxHC.shadowOpacity}"
			                border="#{suggestionBoxHC.border}" width="#{suggestionBoxHC.width}"
			                height="#{suggestionBoxHC.height}"
			                shadowDepth="#{suggestionBoxHC.shadowDepth}"
			                cellpadding="#{suggestionBoxHC.cellpadding}">			            
		                <h:column styleClass="inputText">
		                    <h:outputText value="#{result.text}" styleClass="inputText"/>
		                </h:column>
                  </rich:suggestionbox>
                   </h:panelGrid>
		    	 </h:panelGrid>
		    	<h:panelGrid columns="2" style="margin-left:10px;">		    	
		    		<h:outputText value="Tên người đi(*): " id="idout" style="margin-left:15px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="tenNguoiDi" readonly="true" style="margin-left:10px;"  value="#{nguoiDi.tenNguoiDi}" size="20">		    		
		    		</h:inputText>
		    	
		       		<h:outputText value="CMND(*):  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		    		<h:inputText id="cmnd" style="margin-left:10px;" readonly="true" value="#{nguoiDi.cmnd}" size="20" />
		    	 
		    	     <h:outputText value="Năm sinh:  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		    		<h:inputText id="namSinh" style="margin-left:10px;" readonly="true" value="#{nguoiDi.namSinh}" size="20" />
		    	
		    		<h:outputText value="Giới tính:  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		    		<h:inputText id="gioiTinh" style="margin-left:10px;" readonly="true" value="#{nguoiDi.gioiTinh}" size="20" />		    	  
		    	
		    	   <h:outputText value="Chức vụ:  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		    		<h:inputText id="chucVu" readonly="true" style="margin-left:10px;" value="#{nguoiDi.chucVu}" size="30" />
		    	 
		    	   <h:outputText value="Cơ quan:  " style="margin-left:15px;"  styleClass="inputText" ></h:outputText>
		    		<h:inputText id="coQuan" readonly="true" style="margin-left:10px;" value="#{nguoiDi.coQuan}" size="50" />
		    	 
		    	  	
		    	   	<h:outputText value="Trạng thái đi: " style="margin-left:15px;"  styleClass="inputText"></h:outputText>
		    		<h:selectBooleanCheckbox style="margin-left:10px;" value="#{nguoiDi.trangThaiDi}">
               		</h:selectBooleanCheckbox>	
               		
               	</h:panelGrid>					
				<h:panelGrid columns="3" style="margin-left:150px;margin-top:10px;margin-bottom:1px">
			    	<a4j:commandButton value="Tạo mới" styleClass="Button" action="#{nguoiDi.taoMoiNguoiDi}"></a4j:commandButton>
			    	<a4j:commandButton value="Cập nhật" styleClass="Button" action="#{nguoiDi.capNhatThongTin}"></a4j:commandButton>
			     	<a4j:commandButton type="Button" value="Hoàn thành" styleClass="Button" action="#{nguoiDi.hoanThanhThemMoi}"></a4j:commandButton>
			     </h:panelGrid>		
			     </h:form>
		  	 </rich:panel>	
			  <h:panelGrid columns="1" style="margin-left:0px;">		       		
		       		<h:outputText value="Danh sách thành viên " styleClass="inputText" ></h:outputText>		       			    		
				</h:panelGrid>
					
			<!-- Bat dau table -->
					<h:form>
					<h:dataTable id="list" value="#{nguoiDi.listTableNguoiDi}" var="Item" 
								columnClasses="column" headerClass="TableHeader" rowClasses="ROW1,ROW2" footerClass="TableFooter" 
					       style="width:100%; margin-left:0px;margin-top: 10px" cellspacing="1px;" rows="10">
						<h:column >
							<f:facet name="header">
								<h:outputText value="STT"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.stt}"></h:outputText>
							<f:facet name="footer">
								<rich:spacer></rich:spacer>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Tên thành viên"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.tenNguoiDi}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Số HC"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.soHC}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Năm sinh"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.namSinh}"></h:outputText>
						</h:column>
							<h:column>
							<f:facet name="header">
								<h:outputText value="Cơ quan"></h:outputText>
							</f:facet>
							<h:outputText value="#{Item.coQuan}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Xóa" ></h:outputText>
							</f:facet>
							<a4j:commandLink  action="#{nguoiDi.xoanguoidi}"
											onclick="if(!confirm('Bạn muốn xóa thành viên này ?')) 
							 							{return false;}">
								<h:graphicImage value="/qldoanra/func01/images/icoDelete.gif"></h:graphicImage>
								<f:param name="id" value="#{Item.id}" />
								<f:param name="stt" value="#{Item.stt}" />
							</a4j:commandLink>
						</h:column>				
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sửa"></h:outputText>
							</f:facet>
							 <a4j:commandLink  action="#{nguoiDi.loadThongTin}">
							 	<h:graphicImage value="/quantri/pqcn/images/icoEdit.gif"></h:graphicImage>
							 	<f:param name="id" value="#{Item.id}"/>
							 	<f:param name="soHC" value="#{Item.soHC}"/>
							 	<f:param name="tenNguoiDi" value="#{Item.tenNguoiDi}"/>
							 	<f:param name="cmnd" value="#{Item.cmnd}"/>
							 	<f:param name="gioiTinh" value="#{Item.gioiTinh}"/>
							 	<f:param name="namSinh" value="#{Item.namSinh}"/>
							 	<f:param name="chucVu" value="#{Item.chucVu}"/>
							 	<f:param name="coQuan" value="#{Item.coQuan}"/>
							 	<f:param name="trangThaiDi" value="#{Item.trangThaiDi}"/>
							  </a4j:commandLink>
						</h:column>
				
					</h:dataTable>
						<!-- phan trang -->
						<rich:datascroller align="right"  for="list" maxPages="5" />
						<!-- ket thuc phan trang -->			
				</h:form>	
				
    </h:panelGrid>
   </h:panelGrid>
 
 </ui:define>
 </ui:composition> 
</body>	
</html>